package com.young.eventcoach.board;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;

import com.young.eventcoach.R;
import com.young.eventcoach.network.BoardItemData;

public class BoardDetailFooterView extends LinearLayout {
	EditText et_reply_content;
	Button replyButton;
	String reply_content;
	
	public interface OnReplySendClickListener {
		public void onReplySendClick(String replyContent);
	}
	
	private OnReplySendClickListener mListener;
	
	public void setOnReplySendClickListener(OnReplySendClickListener listener) {
		mListener = listener;
	}
	
	public BoardDetailFooterView(Context context) {
		super(context);
		LayoutInflater.from(context).inflate(R.layout.board_show_footer, this);

		replyButton = (Button) findViewById(R.id.reply);
		et_reply_content = (EditText) findViewById(R.id.et_reply_content);
		
		replyButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				reply_content = et_reply_content.getText().toString();
				mListener.onReplySendClick(reply_content);
				et_reply_content.setText("");
			}
		});
	}

	public BoardDetailFooterView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public BoardDetailFooterView(Context context, BoardItemData mItem) {
		super(context);
		
	}
	
	

}
